#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 2e5 + 10;

int n, x;
LL a[N], b[N];

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    LL res = 9223372036854775807;
    cin >> n >> x;
    for(int i = 1; i <= n; i ++) cin >> a[i] >> b[i];

    LL cur = 0;
    for(int i = 1; i <= x && i <= n; i ++){
        cur += a[i] + b[i];
        res = min(res, cur + (LL)(x - i) * b[i]);
    }

    cout << res;

    return 0;
}